package com.leung.mybatis.session.defaults;


import com.leung.mybatis.binding.MapperRegistry;
import com.leung.mybatis.session.SqlSession;
import com.leung.mybatis.session.SqlSessionFactory;

/**
 * @author 丨一
 * @version 1.0
 * @title DefaultSqlSessionFactory
 * @description:
 * @date 2025/10/8 下午2:55
 */
public class DefaultSqlSessionFactory implements SqlSessionFactory {

    private final MapperRegistry mapperRegistry;

    public DefaultSqlSessionFactory(MapperRegistry mapperRegistry) {
        this.mapperRegistry = mapperRegistry;
    }

    @Override
    public SqlSession openSession() {
        return new DefaultSqlSession(mapperRegistry);
    }
}
